home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 March / EnigmA AMIGA RUN 25 (1997)(G.R. Edizioni)(IT)[!][issue 1998-03].iso / shape-files / shapedisk01.ssf / MoreTools / A-MaxUtilsV1.1.s Folder / EpsonDriver / 1.0.0Docs.txt next >
Text File  |  1993-02-03  |  11KB  |  195 lines

  1. Epson Dot Matrix Printer Driver
  2.  
  3. Who?
  4. © 1991, 1992, 1993 Charles Rentmeesters
  5. Much thanks to Symantec for providing such a wonderful C compiler and environment for the Macintosh.  And thanks of course to Apple Computer for producing such a good computer.
  6.  
  7. What?
  8. "Chuck's Printer Driver" is a printer driver -- chooser device for using Epson dot-matrix printers (and compatibles) with your Macintosh computer.  It has been tested on a Macintosh SE and a Macintosh IIci (systems 6.0.5 through 7.1, English and Kanji versions), with a Panasonic KX-P1080i printer.  It prints in Text (draft or NLQ) mode and Graphics (Low, Medium, and High) modes.  It is Freeware, however I do request a small donation ($20 U.S.) to help pay for my costs.  I would like to hear what you think of it, and what I should add, even if you don't send me money.  Note: There are still bugs in the text printing option,  but the graphics modes should work fine. (I really don't want to support text printing that much, there is a better public-domain printer driver already that does a good job of that called "Daisy".)
  9.  
  10. How?
  11. You can use the printer driver by dropping it into your system folder, and selecting it from the chooser desk accessory.  You should also take time to choose the set-up option in chooser so that the printer driver knows how to access your printer and what type of printer it is.  You need to have some sort of serial to parallel converter if  you are trying to hook-up a printer that only has a parallel port -- see your printer manual.  The Grappler 9-pin interface can be turned into a simple serial to parallel converter by setting all of its dip-switches to the ON position.  Otherwise, talk to your local computer retailer about getting a serial-to-parallel converter.  They can range anywhere from $30 (US dollars) to several hundred for fancy ones with large memory buffers.
  12.  
  13. How do I hook up my serial printer to my Macintosh?
  14. If you have a serial printer, that is, one with an RS232 or RS422 interface, all you need is a serial cable from your computer to your printer.  These can be bought from your local computer dealer.
  15.  
  16. If you wish to make your own Macintosh serial to RS232 cable, these are the pin connections for a 8pin mini-din Macintosh serial port to the standard RS232 pin outs.
  17. Mac pin    RS232 pin    Description
  18. 1                20&4            Handshake Out
  19. 2                8                        Handshake Input
  20. 4&8        7                        Ground
  21. 5                3                        Receive Data
  22. 3                2                        Transmit Data
  23.  
  24. Depending on the printer, you may have to null-modem that cable, which would mean switching pins 5 &3 and also pins 1 & 2 at the Macintosh connector.
  25.  
  26. Where?
  27. I can most likely be reached by internet e-mail to roach@khan.cs.wisc.edu,  roach@saavik.cs.wisc.edu, or rentmees@cae.wisc.edu.  I read this mail  approximately once a week, and will respond via internet e-mail usually  within a day.  I can also be reached by US mail:
  28.     Charles Rentmeesters
  29.     410 North Carroll St
  30.     Madison, WI 53703-1804
  31.     U.S.A.
  32.  
  33. Why?
  34. After receiving the 9-pin Grappler interface, and being disappointed in the way that it handled things, I decided to write my own printer driver in software.  A software version would have more options and control over the original printer, where the Grappler only used the Imagewriter driver and did conversion in hardware.  I thought this was a tremendous kludge.
  35.  
  36. When?
  37. Version 1.0.0 is available now.  New versions will be released when I receive enough feedback to release a new version.
  38.  
  39. Disclaimer
  40. The Printer Driver is freeware, copy it and give it to all your friends.  This program can not and should not be sold for any price, it is free.  (I would like a donation of $20 though, if you use the printer driver).  I do not take any responsibility for the use of my  software, use at your own risk, it may have bugs.
  41.  
  42. Technical
  43. The program uses the following printer control codes  (Epson 9-pin mode):
  44. For draft and NLQ modes:
  45.     ESC x 1        Set NLQ mode
  46.     ESC x 0        Set draft mode
  47.     ESC - 1        Underline On
  48.     ESC - 0        Underline Off
  49.     ESC E        Bold printing on
  50.     ESC F        Bold printing off
  51.     ESC 4        Italics on
  52.     ESC 5        Italics off
  53.     ESC 2        Set scrolling to 1/6 of an inch
  54.     ESC A <x>        Set scrolling to x/72 inches
  55. For graphics mode:
  56.     ESC K        Enter graphics mode, 60dpi
  57.     ESC * 5        Enter graphics mode, 72dpi
  58.     ESC * 4        Enter graphics mode, 80dpi
  59.     ESC * 6        Enter graphics mode, 90dpi
  60.     ESC L        Enter graphics mode, 120dpi
  61.     ESC Z        Enter graphics mode, 240dpi
  62.     ESC A <x>        Set scrolling to x/72 inches
  63.     ESC 2        Set scrolling to 1/6 of an inch
  64.     ESC 3 <x>        Set scrolling to x/216 inches
  65.  
  66. How do I modify the printer codes?
  67. If you have the program ResEdit, you can modify the printer codes that the printer driver uses to print.  There are two resource types that you can modify, ResEdit templates ('TMPL' resources) are included in the Printer Driver to allow you to easily modify the resources.  First there is the 'Pdcf' resource, it describes the Paper Page Definitions in the Page Setup Dialog, and it also tells the printer driver what resolution to print at for graphic low, medium, and high quality printing.  Second is the 'Ptyp' resource.  The 'Ptyp' resource tells the Printer Driver what codes to send to the printer.
  68.  
  69. The 'Pdcf' Resource
  70. The 'Pdcf' Resource Has the following format:
  71. Data type    ResEdit type    Description
  72. short        DWRD    horz low resolution
  73. short        DWRD    vert low resolution
  74. short        DWRD    horz medium resolution
  75. short        DWRD    vert medium resolution
  76. short        DWRD    horz high resolution
  77. short        DWRD    vert high resolution
  78. short        DWRD    horz default resolution
  79. short        DWRD    vert default resolution
  80.         LSTB        Up to 6 page definitions will be put in the Style 
  81.                 Dialog.
  82. boolean    BOOL    set if next description is in metric
  83. long        DLNG    Width in thousand's of a cm for metric and 
  84.                 thousand's of an inch for non-metric
  85. long        DLNG    Height in thousand's of a cm for metric and 
  86.                 thousand's of an inch for non-metric
  87. long        DLNG    Left border (same scale as above)
  88. long        DLNG    Right border (same scale as above)
  89. long        DLNG    Top border (same scale as above)
  90. long        DLNG    Bottom border (same scale as above)
  91. char []    ESTR    Name of the page type
  92.         LSTE    
  93. 'Pdcf' number 0 is the one that is currently being used by the printer.  From the chooser setup you can choose which of these resources is number 0.  The pop-up menu called "Dialog setup" is made from the names of the 'Pdcf' resources, so it is important to name any new 'Pdcf's that you make.
  94.  
  95. The 'Ptyp' Resource
  96. The 'Ptyp' resource has the following format:
  97. Data type    ResEdit type    Description
  98. char []    ESTR    Name of Printer Type
  99. short        OCNT    Number of Text Commands
  100.         LSTC    
  101. short        DWRD    Text Command, one of:
  102.                 0 - Set NQL Mode
  103.                 1 - Set Draft Mode
  104.                 2 - Underline On
  105.                 3 - Underline Off
  106.                 4 - Bold On
  107.                 5 - Bold Off
  108.                 6 - Italics On
  109.                 7 - Italics Off
  110.                 8 - Reset
  111. char []    ESTR    Text Command Code
  112.         LSTE    
  113. short        OCNT    Number of Scroll Commands
  114.         LSTC    
  115. short        DWRD    Scroll Resolution in fractions of an inch
  116.                 (i.e. To scroll x/72 this number would be 72)
  117. short        DWRD    Scroll Type, one of:
  118.                 0 - Scroll Immediately, variable amount 
  119.                    (i.e. scroll x/216)
  120.                 1 - Set Line Feed, fixed amount
  121.                    (i.e. set line-feed to scroll 1/6)
  122.                 2 - Set Line Feed, variable amount
  123.                    (i.e. set line-feed to scroll x/72)
  124. char []    ESTR    Scroll Command Code
  125.         LSTE    
  126. short        OCNT    Number of Printhead modes
  127.         LSTC    
  128. short        DWRD    Number of pins in this printhead-mode, one of:
  129.                 8 - for 9-pin printers
  130.                 24 - for 24-pin printers
  131. short        DWRD    Distance between each pin on the print head in 
  132.                 fractions of an inch.  Usually:
  133.                 72 - for 9-pin printers (1/72 inch)
  134.                 60 - for 24-pin printers w/8 pins printing (1/60 in.)
  135.                 180 - for 24-pin printers w/24 pins printing
  136. short        OCNT    Number of Horizontal Resolutions for this Printhead
  137.                  mode
  138.         LSTC    
  139. short        DWRD    Horizontal Resolution in fractions of an inch.
  140. char []    ESTR    Graphics Printing Code
  141.         LSTE    
  142.         LSTE    
  143. 'Ptyp' number 0 is the one that is currently being used by the printer.  From the chooser setup you can choose which of these resources is number 0.  The pop-up menu called "Printer type" is made from the names of the 'Ptyp' resources, so it is important to name any new 'Ptyp's that you make.  For the code strings you can place control characters in as a caret character ('^') followed by a second character.  That second character is ANDed with hex 1F to get the control character.  (i.e. "^A" is interpreted as $01, "^J" is interpreted as $0A).  To put a caret character ('^') in the control string, you must put two caret characters (i.e. "^^").
  144.  
  145. The 'PSET' 0 Resource
  146. This contains information about the serial port to open up, as set by the Chooser Code.  It is written to whenever you leave the Setup dialog in the chooser with the response of OK.  The structure of this resource is:
  147. typedef struct {
  148.     SerShk    Handshake;
  149.     short        serConfig;
  150.     char        deviceName[20];
  151.     } mySetup;
  152. Notice: if the user wishes to set the deviceName to something other than .AOut or .BOut, they can, as long as the other device can also receive the same serial setup commands that .AOut and .BOut can.
  153.  
  154. Version History
  155. New in version 0.2.0:
  156. ¥    Page size is now completely adjustable by the user.
  157. ¥    There is a 'Copies' option in the Job dialog now, but it only works for
  158.      Graphics printing modes.
  159. ¥    Now responds partially to PrGeneral call.  Some applications required
  160.      PrGeneral to exist for them to print properly.
  161. ¥    Dialogs come up a bit cleaner.  (There was some flashing before as it
  162.      would set options and center the dialog.)
  163. ¥    Slightly more robust performance in low memory situations.
  164. ¥    Bug fixed where output was not scaled properly for graphics printing.
  165. ¥    System 7 balloon help for the dialogs.
  166. New in version 1.0.0:
  167. ¥    Dialogs are configurable from ResEdit.
  168. ¥    Printer Codes are configurable from ResEdit.
  169. ¥    More Robust.
  170. ¥    Wordy error messages, not just numbers.
  171. ¥    Color Icons.
  172. ¥    Landscape printing mode.
  173. ¥    Fixed command-period cancel bug.
  174. ¥    Fixed Xon-Xoff flow control bug.
  175. ¥    Dialogs pay attention to escape key as cancel.
  176.  
  177. What does the future hold?
  178. Some time in 93, Apple is supposed to release Quickdraw QD, an extension to quickdraw that is supposed to have a completely new printing manager.  It is rumored that the new printing manager will support more printers.  Upon Quickdraw QD's release I do not know if I will continue to support my printer driver.  It depends on how good a job Quickdraw QD does and if my printer driver will still have a use.
  179. Things I might add if I continue to support the printer driver:
  180. ¥    Support for more types of printers. (Like other than Epson compatible
  181.      dot matrix printers, HP Laserjet printers, and any thing else that I might
  182.      hear about.)
  183. ¥    Support for color printing for printers that can print color.
  184. ¥    Enlargement and Reduction.
  185. ¥    Built in nice editor for its own resources. (So you don't have to use
  186.     ResEdit.)
  187. ¥    Print Spooling.
  188.  
  189. References
  190. DTS (Apple Developer Technical Support) document 'Learning to Drive' and 'Sample Writer' source code, available on Developer's Essentials CD's (and also possibly ftp.apple.com, but I haven't checked)
  191.  
  192. Also the HP Deskjet sources in C.  (I forget where I got a hold of my copy.  -- it's all public domain)
  193.  
  194.  
  195.